{ ... }:
let
  workspaces = builtins.concatLists (builtins.genList (
      x: let
        ws = let
          c = (x + 1) / 10;
        in
          builtins.toString (x + 1 - (c * 10));
      in [
        "$mod, ${ws}, workspace, ${toString (x + 1)}"
        "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
      ]
    )
    10);
in {
  home = {
    sessionVariables = {
      BROWSER = "chromium";
      TERMINAL = "foot";
      EDITOR = "code";

      NIXOS_OZONE_WL = "1";
      WLR_RENDERER = "vulkan";
      CLUTTER_BACKEND = "wayland";
      QT_QPA_PLATFORM = "wayland";
      SDL_VIDEODRIVER = "wayland";

      XDG_CURRENT_DESKTOP = "Hyprland";
      XDG_SESSION_DESKTOP = "Hyprland";
      XDG_SESSION_TYPE = "wayland";
    };
  };

  wayland.windowManager.hyprland = {
    enable = true;
    systemd.enable = true;
    settings = {
      "$mod" = "SUPER";

      exec-once = [
        "hyprpaper"
      ];

      bind = [
        "$mod, Return, exec, foot"
        "$mod, BackSpace, killactive"
        # "$mod, P, exec, wofi"
        
        "$mod, F, fullscreen"
        "$mod, G, togglegroup"
        "$mod, R, togglesplit"
        "$mod, T, togglefloating"

        "$mod, H, movefocus, l"
        "$mod, L, movefocus, r"
        "$mod, J, movefocus, u"
        "$mod, K, movefocus, d"

        "$mod Ctrl, H, movewindow, l"
        "$mod Ctrl, L, movewindow, r"
        "$mod Ctrl, J, movewindow, u"
        "$mod Ctrl, K, movewindow, d"

        "$mod Shift, H, workspace, m-1"
        "$mod Shift, L, workspace, m+1"
      ] ++ workspaces;

      bindm = [
        "ALT, mouse:272, movewindow"
        "$mod ALT, mouse:272, resizewindow"
      ];
    };
  };
}